package com.cskaoyan.config;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @author LiaoLong
 * @date 2021-05-10 23:39
 */
@Configuration
@EnableConfigurationProperties(FileProperties.class)
public class FileConfiguration {

    private FileProperties fileProperties;

    public FileConfiguration(FileProperties fileProperties){
        this.fileProperties = fileProperties;
    }

    @Bean
    public CommonsMultipartResolver multipartResolver(){
        CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
        return commonsMultipartResolver;
    }
}
